package com.summer.framework.auth.authorization.entity;


import com.summer.framework.common.entity.Users;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;
import java.util.Collections;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class MyUser extends Users implements UserDetails {
    private String username;

    private String password;

    private String mobile;

    private boolean enabled;

    private boolean accountNonExpired;

    private boolean credentialsNonExpired;

    private boolean accountNonLocked;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        // 此处可以设置用户的具体权限，这里我们返回空集合
        return Collections.emptySet();
    }
}
